<#include "../../head.ftl">
<div class="page_title">客户信息管理</div>
<div class="button_bar">
    <button class="common_button" onclick="help('');">帮助</button>
    <button class="common_button" onclick="document.forms[0].submit();">查询</button>
</div>
<form action="${url}" method="get">
<table class="query_form_table">
    <tr>
        <th>客户编号</th>
        <td><input type="text" name="identity" value=""/></td>
        <th>名称</th>
        <td><input type="text" name="name" value=""/></td>
        <th>地区</th>
        <td>
            <select name="area">
               <option value="">全部</option>
				<#list areaList as area>
				    <option value="${area.items}">${area.items}</option>
				</#list>
            </select>
        </td>
    </tr>
    <tr>
        <th>客户经理</th>
        <td><input type="text" name="managerUser.name" value=""/></td>
        <th>客户等级</th>
        <td>
            <select name="grade">
                <option value="">全部</option>
				<#list gradeList as grade>
				    <option value="${grade.items}">${grade.items}</option>
				</#list>
            </select>
        </td>
        <th>　</th>
        <td>　</td>
    </tr>
</table>
    <input type="hidden" id="number" name="number" value=""/>
<br />
</form>
<table class="data_list_table">
    <tr>
        <th>序号</th>
        <th>客户编号</th>
        <th>名称</th>
        <th>地区</th>
        <th>客户经理</th>
        <th>客户等级</th>
        <th>操作</th>
    </tr>
	<#list page.content as customer>
	    <tr>
            <td class="list_data_number">${customer.id}</td>
            <td class="list_data_text">${customer.identity}</td>
            <td class="list_data_ltext">${customer.name}</td>
            <td class="list_data_text">${customer.area}</td>
            <td class="list_data_text">${customer.managerUser.name}</td>
            <td class="list_data_text">${customer.grade}</td>
            <td class="list_data_op">
				<a href="${base}/customer/queryBefore?id=${customer.id}">
                    <img title="编辑" src="${base}/images/bt_edit.gif" class="op_button" />
				</a>
                <a href="${base}/contact/list?customerid=${customer.id}">
                    <img title="联系人" src="${base}/images/bt_linkman.gif" class="op_button" />
                </a>
                <a href="${base}/record/list?customerid=${customer.id}">
                    <img title="交往记录" src="${base}/images/bt_acti.gif" class="op_button" />
                </a>
                <a href="${base}/orders/list?customerid=${customer.id}">
                    <img title="历史订单" src="${base}/images/bt_orders.gif" class="op_button" />
                </a>
				<#if customer.grade == '普通客户'>
				    <a href="${base}/customer/delete?id=${customer.id}">
                        <img title="删除" src="${base}/images/bt_del.gif" class="op_button" />
                    </a>
				</#if>
            </td>
        </tr>
	</#list>
    <tr>
        <th colspan="100" class="pager">
<#include "../../foot.ftl">